import {
  lendcompany, lendrefuse, handover, confirmhandover, handovere, handoverrefuse, giveback,
  addresource, editresource, deleteresource,
  addvoucher_storage, editvoucher_storage, deletevoucher_storage, addaccount_book, editaccount_book,


} from '@/services/dossier';

const UserModel = {
  namespace: 'dossier',
  state: {
    currentUser: {},
  },
  effects: {
    *lendcompany({ payload }, { call, put }) {
      const response = yield call(lendcompany, payload);
      return response
    },
    *lendrefuse({ payload }, { call, put }) {
      const response = yield call(lendrefuse, payload);
      return response
    },
    *handover({ payload }, { call, put }) {
      const response = yield call(handover, payload);
      return response
    },
    *confirmhandover({ payload }, { call, put }) {
      const response = yield call(confirmhandover, payload);
      return response
    },
    *handovere({ payload }, { call, put }) {
      const response = yield call(handovere, payload);
      return response
    },
    *handoverrefuse({ payload }, { call, put }) {
      const response = yield call(handoverrefuse, payload);
      return response
    },
    *giveback({ payload }, { call, put }) {
      const response = yield call(giveback, payload);
      return response
    },
    *addresource({ payload }, { call, put }) {
      const response = yield call(addresource, payload);
      return response
    },
    *editresource({ payload }, { call, put }) {
      const response = yield call(editresource, payload);
      return response
    },
    *deleteresource({ payload }, { call, put }) {
      const response = yield call(deleteresource, payload);
      return response
    },

    *addvoucher_storage({ payload }, { call, put }) {
      const response = yield call(addvoucher_storage, payload);
      return response
    },
    *editvoucher_storage({ payload }, { call, put }) {
      const response = yield call(editvoucher_storage, payload);
      return response
    },
    *deletevoucher_storage({ payload }, { call, put }) {
      const response = yield call(deletevoucher_storage, payload);
      return response
    },

    *addaccount_book({ payload }, { call, put }) {
      const response = yield call(addaccount_book, payload);
      return response
    },
    *editaccount_book({ payload }, { call, put }) {
      const response = yield call(editaccount_book, payload);
      return response
    }

  },
  reducers: {
    saveCurrentUser(state, action) {
      return { ...state, ...action.payload };
    }
  },
};
export default UserModel;
